package com.vitabuybuy.tv.ui.mine.talent.goods

import android.os.Bundle
import com.flyco.tablayout.listener.CustomTabEntity
import com.vitabuybuy.tv.R
import com.vitabuybuy.tv.databinding.FragmentMyCommodityBinding
import com.vitabuybuy.tv.dto.TabEntity
import com.library.common.base.BaseFragment
import com.library.common.base.MessageModel
import com.vitabuybuy.tv.ui.mine.talent.goods.viewmodel.MyCommodityViewModel
import kotlinx.android.synthetic.main.fragment_my_commodity.*
import java.util.*

class MyCommodityFragment : BaseFragment<MyCommodityViewModel, FragmentMyCommodityBinding>() {
    override val layoutId: Int
        get() = R.layout.fragment_my_commodity
    private val mTabEntities = ArrayList<CustomTabEntity>()

    override fun initView(savedInstanceState: Bundle?) {
        mBinding?.mViewModel = viewModel
        mTabEntities.apply {
            add(TabEntity(getString(R.string.all), 0, 0))
            add(TabEntity(getString(R.string.wait_to_put), 0, 0))
            add(TabEntity(getString(R.string.wait_to_show), 0, 0))
            add(TabEntity(getString(R.string.have_finished), 0, 0))
        }
        mTabLayout_1.setTabData(mTabEntities)
    }

    override fun lazyLoadData() {
        viewModel.getData()
    }

    override fun handleEvent(msg: MessageModel) {
        when (msg.code) {
            0 -> {
            }
            1 -> {

            }
            2 -> {

            }
        }
    }
}
